import canvasAbstract from "./canvasAbstract";
import config from "../../config";
import model from "../model/boss"

// @ts-ignore
class boss extends canvasAbstract implements ICanvas {
  constructor() {
    super('bullet')
  }
  render(): void {
    this.createModels()
    // 绘制模型
    super.renderModels()
  }

  model(): ModelConstructor {
    return model
  }

  num(): number {
    return 1
  }

  // 生成物体模型实例
  protected createModels() {
    let position: {x : number, y: number} = {x : 0, y : 0}
    position.x = config.canvas.width / 2
    position.y = config.canvas.height - config.model.height
    const model = this.model()
    const instance = new model(position)
    this.models.push(instance)
  }
}

export default new boss()
